<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8"/>
        <title>World of Video Games Admin - Martel & Giammetta</title>
        <link rel="stylesheet" type="text/css" media="screen" href="style.css" />
        <script type="text/javascript" src="scripts/jquery-1.5.2.min.js"></script>
        <script type="text/javascript" src="scripts/hideshow.js"></script>
        <script type="text/javascript" src="scripts/jquery.equalHeight.js"></script>
        <script type="text/javascript" src="scripts/jquery.tablesorter.min.js"></script>
        <script type="text/javascript">
            $(function() {
                $('.column').equalHeight();
                $(".tablesorter").tablesorter();

                $('a[rel*=external]').click(function() {
                    window.open(this.href);
                    return false;
                });
            });
        </script>
    </head>
    <body>
        <c:choose>
            <c:when test="${param.page == 'categories'}">
                <c:set var="titre" value="Categories" />
            </c:when>
            <!-- ... -->
            <c:when test="${param.page == 'products'}">
                <c:set var="titre" value="Video Games" />
            </c:when>
            <c:when test="${param.page == 'users'}">
                <c:set var="titre" value="Users" />
            </c:when>
            <c:otherwise>
                <c:set var="titre" value="DashBoard" />
            </c:otherwise>
        </c:choose>
        <header id="header">
            <hgroup>
                <h1 class="site_title"><a href="?page=home">WoVG Admin</a></h1>
                <h2 class="section_title">${titre}</h2>
                <div class="btn_view_site"><a href="..">View Site</a></div>
            </hgroup>
        </header> <!-- end of header bar -->
        <section id="secondary_bar">
            <div class="user">
                <p>John Doe (<a href="#">3 Messages</a>)</p>
                <a class="logout_user" href="?page=account&action=logout" title="Logout">Logout</a>
            </div>
            <div class="breadcrumbs_container">
                <article class="breadcrumbs">
                    <a href="?page=home">World of Video Games Admin</a>
                    <div class="breadcrumb_divider"></div>
                    <a class="current">${titre}</a>
                </article>
            </div>
        </section><!-- end of secondary bar -->
        <aside id="sidebar" class="column">
            <form class="quick_search">
                <input type="text" value="Quick Search" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
            </form>
            <hr/>
            <h3>Content</h3>
            <ul class="toggle">
                <li class="icn_new_article"><a href="?page=add_product">New Video Games</a></li>
                <li class="icn_edit_article"><a href="?page=products">Edit Video Games</a></li>
                <li class="icn_categories"><a href="?page=categories">Categories</a></li>
                <!--<li class="icn_tags"><a href="?page=tags">Tags</a></li>-->
            </ul>
            <h3>Users</h3>
            <ul class="toggle">
                <li class="icn_add_user"><a href="?page=add_user">Add New User</a></li>
                <li class="icn_view_users"><a href="?page=users">View Users</a></li>
                <li class="icn_profile"><a href="?page=account">Your Profile</a></li>
            </ul>
            <h3>Admin</h3>
            <ul class="toggle">
                <li class="icn_settings"><a href="?page=options">Options</a></li>
                <li class="icn_jump_back"><a href="?page=account&action=logout">Logout</a></li>
            </ul>
            <footer>
                <hr />
                <p><strong>Copyright &copy; 2011 <a href="?page=home" title="World of Video Games Admin">World of Video Games Admin</a></strong></p>
                <p>Theme by <a href="http://www.medialoot.com" rel="external">MediaLoot</a></p>
            </footer>
        </aside><!-- end of sidebar -->
        <section id="main" class="column">
            <c:choose>
                <c:when test="${param.page != null && !empty param.page && param.page != 'home'}">
                    <c:catch var="e">
                        <c:import url="${param.page}.jsp" />
                    </c:catch>
                    <c:if test="${!empty e}">
                        <c:redirect url="/?page=error" />
                    </c:if>
                </c:when>
                <c:otherwise>
                    <c:import url="default.jsp" />
                </c:otherwise>
            </c:choose>
            <div class="spacer"></div>
        </section>
    </body>
</html>